package display {
	
	import display.screens.*;
	
	import flash.display.MovieClip;
	import flash.display.Sprite;
	import flash.errors.IllegalOperationError;
	
	/**
	 * Contains method to get screen by its name.
	 * 
	 * @author Vjekoslav Ratkajec
	 */
	public class Screens {
		
		/**
		 * @private
		 */
		public function Screens() {
			throw new IllegalOperationError();
		}
		
		/**
		 * Get instance of screen by its name.
		 * 
		 * @param	name	Screen name
		 * @return	Choosen screen instance.
		 */
		public static function getScreen(name:String):Sprite {
			var result:Sprite = null;
			switch (name) {
				case "start":
					result = new StartScreen();
					break;
				case "about":
					result = new AboutScreen();
					break;
				case "apartments":
					result = new ApartmentsScreen();
					break;
				case "business":
					result = new BusinessScreen();
					break;
				case "garage":
					result = new GarageScreen();
					break;
				case "search":
					result = new SearchScreen();
					break;
				case "faq":
					result = new FaqScreen();
					break;
				case "contact":
					result = new ContactScreen();
					break;
				case "layout":
					result = new LayoutScreen();
					break;
					
				default:
					throw new Error("Illegal menu item");
			}
			
			return result;
		}
		
	}

}